import java.util.Arrays;

public class Main {
    public static void main4(String[] args) {
        //不规则数组
        //省略列的二维数组
        int[][] a = new int[2][];
        System.out.println(a[0]);//没有列的时候没有具体指向
        System.out.println(a[1]);//输出位null
        a[0] = new int[]{1, 2, 3};
        a[1] = new int[]{4, 5, 6,7};
        System.out.println(Arrays.toString(a[0]));
        System.out.println(Arrays.toString(a[1]));
    }
    public static void main3(String[] args) {
        int[][] arr = new int[3][3];

       for(int[] x : arr) {
           for (int ele : x) {
               System.out.print(ele+" ");
           }
           System.out.println();
       }
    }
    public static void main2(String[] args) {
        int[][] a = new int[3][3];
        for (int i = 0; i < a.length; i++) {
            for (int j = 0; j < a[i].length; j++) {
                System.out.print(a[i][j]);
            }
            System.out.println();
        }
    }
    public static void main1(String[] args) {
        int[][] arr = {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}};
        int[][] arr2 = new int[2][3];
        for(int i = 0; i < 2; i++){
            for(int j = 0; j < 3; j++){
                System.out.print(arr2[i][j]+" ");
            }
            System.out.println();
        }
        System.out.println();
        System.out.println(Arrays.deepToString(arr2));
    }
}